class Box {
	double height, width, depth;
	/*
	 * @Author - Santosh Gajul
	 */
	Box (Box b){
		height = b.height;
		width = b.width;
		depth = b.depth;
	}
	Box (double h, double w, double d){
		height = h;
		width = w;
		depth = d;
	}
	Box(){
		height = width = depth = -1;
	}
	Box (double len){
		height = width = depth = len;
	}
	double volume(){
		return height*width*depth;
	}
}
class BoxWeight extends Box {
	double weight;
	BoxWeight(BoxWeight bw){
		super(bw);
		weight = bw.weight;
	}
	BoxWeight(double h, double w, double d, double m){
		super(h,w,d);
		weight = m;
	}
	BoxWeight(){
		super();
		weight = -1;
	}
	BoxWeight(double len, double w){
		super(len);
		weight = w;
	}
}
class Shipment extends BoxWeight{
	double cost;
	Shipment(Shipment s){
		super(s);
		cost = s.cost;
	}
	Shipment(double h, double w, double d, double m, double c){
		super (h,w,d,m);
		cost = c;
	}
	Shipment() {
		super();
		cost = -1;
	}
	Shipment(double len, double m, double c){
		super(len, m);
		cost = c;
	}
}
public class MultilevelInheritance {
	public static void main(String[] args){
		Shipment s1 = new Shipment(1,2,3,4.5,5.6);
		Shipment s2 = new Shipment(2,3,4,5.6,7.8);
		
		System.out.println("Volume 1 : " + s1.volume());
		System.out.println("Weight 1 : " + s1.weight);
		System.out.println("Cost 1 : " + s1.cost + "\n");
		
		System.out.println("Volume 2 : " + s2.volume());
		System.out.println("Weight 2 : " + s2.weight);
		System.out.println("Cost 2 : " + s2.cost);
	}
}